/*
 * @Description:
 * @Autor: lcz
 * @LastEditors: lcz
 * @LastEditTime: 2023-10-13 15:28:50
 */
export default function injectConst() {
  //虚拟模块ID import xxx from 'virtual:const'
  const virtualModuleId = "virtual:const";
  const resolvedVirtualModuleId = "\0" + virtualModuleId;
  return {
    name: "vite-plugin-injectConst",
    //id 模块
    resolveId(id) {
      if (id === virtualModuleId) {
        return resolvedVirtualModuleId;
      }
    },
    //id 模块
    load(id) {
      if (id === resolvedVirtualModuleId) {
        return `export default {
          title: "test",
          LogoSize: "40"
        }`;
      }
    }
  };
}
